import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, Slides } from 'ionic-angular';

/**
 * Generated class for the TaskPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-task',
  templateUrl: 'task.html',
})
export class TaskPage {
  @ViewChild('slides') slides: Slides;

  dailyTask:any;
  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad TaskPage');
    this.dailyTask = [{}, {}, {}]
  }

  //页面进入时启动自动播放
  ionViewDidEnter(){
   this.slides.startAutoplay();
  }
  //页面离开时停止自动播放
  ionViewDidLeave(){
   this.slides.stopAutoplay();
  }


}
